package com.detoandy.dao;

import com.detoandy.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

/**
 * Created by zhengdt on 2017/8/20.
 */
public interface UserRepository extends JpaRepository<User,String> {

    @Modifying
    @Query("update user set name = :name and password = :password where login_id = :loginId")
    int updateUser(@Param(value = "name") String name,@Param(value = "password") String password,
                   @Param(value = "loginId") String loginId);
}
